﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="OccupancyReport.aspx.cs" Inherits="LuxuryResort.WebSite.NationalAdmin.ReportOccupancy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <!-- add styles -->
    <link href="../Styles/jquery-ui-1.10.4.custom.min.css" rel="stylesheet" type="text/css" />
    <!-- add scripts -->
    <script src="../Scripts/jquery-ui-1.10.4.custom.min.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Occupancy Report</h1>
    <div>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="txtFromDate" Display="Dynamic" 
            ErrorMessage="From Date is required!" ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ControlToValidate="txtToDate" Display="Dynamic" 
            ErrorMessage="To Date is required!" ForeColor="Red"></asp:RequiredFieldValidator>
    </div>
    <div>
        <h1><asp:Label ID="lblOccupancyRate" runat="server"/></h1>
    </div>
    <fieldset>
        <legend>Occupancy Report Filters</legend>
        <table width="70%">
            <tr>
                <td>
                    From Date: <asp:TextBox ID="txtFromDate" runat="server"/>
                    
                </td>
                <td>
                    To Date: <asp:TextBox ID="txtToDate" runat="server"/>
                </td>
                <td>
                    <asp:Button ID="btnViewReport" runat="server" Text="View Report" 
                        onclick="btnViewReport_Click" />
                </td>
            </tr>
        </table>
    </fieldset>
    <br />
    <div runat="server" id="divReportView">
        <asp:ListView ID="lvOccupancies" runat="server">
            <LayoutTemplate>
                <table class="roomList" width="30%">
                    <tr>
                        <th style="width: 20%">
                            Room No
                        </th>
                        <th align="left">
                            Total Days
                        </th>
                    </tr>
                    <tr runat="server" id="itemPlaceholder">
                    </tr>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr>
                    <td style="width: 10%; text-align: center">
                        <asp:Label ID="lblRoomNo" runat="server" Text='<%#Eval("RoomNo") %>' />
                    </td>
                    
                    <td>
                        <asp:Label ID="lblTotalDays" runat="server" Text='<%#Eval("TotalDays") %>' />
                    </td>
                </tr>
            </ItemTemplate>
        </asp:ListView>
        <asp:DataPager ID="pgRooms" runat="server" PagedControlID="lvOccupancies" PageSize="10">
            <Fields>
                <asp:NextPreviousPagerField ShowFirstPageButton="True" ShowNextPageButton="False" />
                <asp:NumericPagerField />
                <asp:NextPreviousPagerField ShowLastPageButton="True" ShowPreviousPageButton="False" />
            </Fields>
        </asp:DataPager>
    </div>
    <script type="text/javascript">
        $(function () {
            $.datepicker.setDefaults(
                $.extend($.datepicker.regional[''])
            );
            $('[id$="txtFromDate"]').datepicker({ dateFormat: 'mm/dd/yy' });
            $('[id$="txtToDate"]').datepicker({ dateFormat: 'mm/dd/yy' });
            //            $('[id$="txtDateFrom"]').datepicker({ dateFormat: 'dd/mm/yy' });
            //            $('[id$="txtDateTo"]').datepicker({ dateFormat: 'dd/mm/yy' });
        });
    </script>
</asp:Content>
